package com.ysx.server.utils;

import cn.hutool.captcha.CaptchaUtil;
import cn.hutool.captcha.LineCaptcha;

/**
 * 验证码工具
 */
public class CaptchaUtils {
    //验证码Redis KEY
    public static final String CAPTCHA_NAME="captcha";
    //设置验证码时间(分钟)
    public static final long CAPTCHA_TIME= 2;

    /**
     * 获取验证码
     * @return
     */
    public static String getCaptcha(){
        LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(200, 100);
        return lineCaptcha.getCode();
    }
}
